Skip to content

Ruby: Fix bug in implicitAssignmentNode#21907

Draft
hvitved wants to merge 2 commits into
github:mainfrom
hvitved:ruby/implicit-local-fix
Draft

Ruby: Fix bug in implicitAssignmentNode#21907
hvitved wants to merge 2 commits into
github:mainfrom
hvitved:ruby/implicit-local-fix

Conversation

@hvitved
Copy link
Copy Markdown
Contributor

@hvitved hvitved commented May 29, 2026

A small bug fix where in cases like

class RescueSetter
  def name
    @name
  end

  def name=(value)
    @name = value
  end

  def foo(msg)
    raise msg
  rescue => self.name # calls `name=`
    :caught
  end
end

self.name was incorrectly marked as updating variables named self and name, instead of calling the name= setter.

@github-actions github-actions Bot added Ruby Rust Pull requests that update Rust code labels May 29, 2026
Comment thread ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
@hvitved hvitved force-pushed the ruby/implicit-local-fix branch from 0ef4595 to c319680 Compare June 2, 2026 07:04
@github-actions github-actions Bot removed the Rust Pull requests that update Rust code label Jun 2, 2026
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Ruby

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants